﻿@model IEnumerable<GameProject.Models.GameInstance>

@{
    ViewBag.Title = "Slönguspilið - Leikir í boði";
}

@section CSS
{
    <link href="~/Content/SnakesAndLadders.css" rel="stylesheet" />
}

<h2>Slönguspilið</h2>
<h3>Leikir í boði</h3>

<p>
    @Html.ActionLink("Búa til nýjan leik", "CreateGame")
</p>
<table id="gameListTable">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CurrentNumberOfPlayers)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ExpectedNumberOfPlayers)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CurrentNumberOfPlayers)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ExpectedNumberOfPlayers)
        </td>
        <td id="play">
            @Html.ActionLink("Spila", "Index", new { id=item.ID })

        </td>
    </tr>
}

</table>
<div>
    @Html.ActionLink("Til baka", "SLGameRules")
</div>
